package com.erp.erp_servers.warehouse.imp;

import com.erp.erp_dao.warehouse.ISellOutStockDetailDao;
import com.erp.erp_entitys.warehouse.entity.SellOutStockDetailEntity;
import com.erp.erp_servers.warehouse.ISellOutStockDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : SellOutStockDetailServiceImp
 * @Description : 销售出库明细实现类
 * @Author : lst
 * @Date: 2020-08-17 19:45
 */
@Service
public class SellOutStockDetailServiceImp implements ISellOutStockDetailService {

    /**
     * 销售出库明细接口
     */
    private final ISellOutStockDetailDao sellOutStockDetailDao;

    @Autowired
    public SellOutStockDetailServiceImp(ISellOutStockDetailDao sellOutStockDetailDao) {
        this.sellOutStockDetailDao = sellOutStockDetailDao;
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public SellOutStockDetailEntity queryById(Integer id) {
        return sellOutStockDetailDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param sellOutStockDetail 实例对象
     * @return 对象列表
     */
    @Override
    public List<SellOutStockDetailEntity> queryAll(SellOutStockDetailEntity sellOutStockDetail) {
        return sellOutStockDetailDao.queryAll(sellOutStockDetail);
    }


    /**
     * 新增数据
     *
     * @param sellOutStockDetail 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(SellOutStockDetailEntity sellOutStockDetail) {
        return sellOutStockDetailDao.insert(sellOutStockDetail);
    }

    /**
     * 详情批量新增
     * @param list 新增对象集合
     * @return 影响行数
     */
    @Override
    public int addList(List<SellOutStockDetailEntity> list) {
        return sellOutStockDetailDao.addList(list);
    }

    /**
     * 修改数据
     *
     * @param sellOutStockDetail 实例对象
     * @return 影响行数
     */
    @Override
    public int update(SellOutStockDetailEntity sellOutStockDetail) {
        return sellOutStockDetailDao.update(sellOutStockDetail);
    }
}
